#!/bin/bash

if [ "$1" == "start" ]
then
    echo "SERVICE START"
    /root/projects/studylinux/worker/test_task1
    /root/projects/studylinux/worker/test_task2
    cat /var/run/daemon-test.pid
else
    echo "SERVICE STOP"
    pid1=$(pidof run)
    pid2=$(pidof daemon)
    [ ! -z ${pid1} ] && kill ${pid1}
    [ ! -z ${pid2} ] && kill ${pid2}
    echo > /var/run/daemon-test.pid
fi
exit 0
